package tmc.app.data;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class GlobalVariables {

	public static String LINK_POST_RECORD_DATA = "http://nhiepphong.info/demo/website/2014_sapporo_game/home/synchronize_awards/";
	public static String LINK_POST_RECORD_USER = "http://nhiepphong.info/demo/website/2014_sapporo_game/home/synchronize_content/";
	
	public static String hoten;
	public static String phone;
	public static int count;
	public static int lanthu;
	public static String result = null;
	public static String tenquan = "";
	
	public static List<ObjRecordData> lstData = new ArrayList<ObjRecordData>();
	public static List<ObjUser> lstUser = new ArrayList<ObjUser>();
	public static ObjRecordData defaultRecordData = null;
	
	public static int index = 0;
	public static int id_giai_thuong = 1;
	public static int indexUser = 0;
	public static boolean isStartWheel = false;
	public static int globalCount = 0;
	public static int globalLastQuan = 0;
	
	public static String AO = "ao";
	public static String BALO = "balo";
	public static String VIET = "viet";
	public static String SO_TAY = "sotay";
	public static String MOC_KHOA = "mockhoa";
	
	public static int loadCountGiaiThuong(Activity activity, String name)
	{
		SharedPreferences pref = activity.getApplicationContext().getSharedPreferences("lucky_draw", 0); // 0 - for private mode
		
		int score = pref.getInt(name, 0);
		
		return score;
	}
	
	public static void saveGiaiThuong(Activity activity, String name, int score)
	{
		SharedPreferences pref = activity.getApplicationContext().getSharedPreferences("lucky_draw", 0); // 0 - for private mode
		Editor editor = pref.edit();
		editor.putInt(name, score);
		editor.commit();
	}
	
	public static void clearGiaiThuong(Activity activity, String name)
	{
		SharedPreferences pref = activity.getApplicationContext().getSharedPreferences("lucky_draw", 0); // 0 - for private mode
		Editor editor = pref.edit();
		editor.remove(name);
		editor.commit();
	}
}
